﻿@model IEnumerable<store.Product>

@{
    ViewBag.Title = "Quản lý sản phẩm";
}
<div id="content">
    <div class="contentTop">
        @Html.Partial("_ContentTopPartial")
    </div>

    <!-- Breadcrumbs line -->
    <div class="breadLine">
        <div class="bc">
            <ul id="breadcrumbs" class="breadcrumbs">
                <li><a href="@Url.Action("Index", "Index")">Trang chủ</a></li>
                <li><a href="@Url.Action("Index")">Quản lý sản phẩm</a>
                </li>
            </ul>
        </div>

        <div class="breadLinks">
            <ul>
                <li class="has">
                    <a title="">
                        <i class="icos-list"></i>
                        <span>Quản lý sản phẩm</span>
                        <span>
                            <img src="~/Content/Admin/images/elements/control/hasddArrow.png" alt="" /></span>
                    </a>
                    <ul>
                        <li><a href="@Url.Action("Index", "Category")" title=""><span class="icos-archive"></span>Danh sách</a></li>
                        <li><a href="@Url.Action("Create", "Category")" title=""><span class="icos-add"></span>Thêm mới</a></li>
                    </ul>
                </li>
                <li class="has">
                    <a title="">
                        <i class="icos-list"></i>
                        <span>Quản lý sản phẩm</span>
                        <span>
                            <img src="~/Content/Admin/images/elements/control/hasddArrow.png" alt="" /></span>
                    </a>
                    <ul>

                        <li><a href="@Url.Action("Index")" title=""><span class="icos-archive"></span>Danh sách</a></li>
                        <li><a href="@Url.Action("Create")" title=""><span class="icos-add"></span>Thêm mới</a></li>
                    </ul>
                </li>
            </ul>
            <div class="clear"></div>
        </div>
    </div>

    <!-- Main content -->
    <div class="wrapper">

        <!-- Table with hidden toolbar -->
        <div class="widget">
            <div class="whead">
                <h6>Danh mục</h6>
                <div class="clear"></div>
            </div>
            <div id="dyn" class="shownpars">
                <a class="tOptions" title="Options">
                    <img src="~/Content/Admin/images/icons/options.png" alt="" /></a>
                <table cellpadding="0" cellspacing="0" border="0" class="dTable" id="dynamic">
                    <thead>
                        <tr>
                            <th></th>
                            <th>Tên sản phẩm</th>
                            <th>Thuộc danh mục</th>
                            <th>Trạng thái</th>
                            <th>Giá tiền</th>
                            <th>Thao tác</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model)
                        {
                            <tr class="gradeA">
                                <td style="width: 50px">
                                    <img width="35" height="37" src="~/Files/thumb/@item.Picture.Split(',')[1]" alt="" />
                                </td>
                                <td>
                                    @item.ProductName
                                </td>
                                <td>
                                    @foreach (var item2 in ViewBag.Categorys)
                                    {
                                        if (item2.CategoryID == item.CategoryID)
                                        {
                                        @item2.Name
                                        }
                                    }
                                </td>
                                <td width="100">
                                    @(item.Active == true ? Html.Raw("Hiển thị") : Html.Raw("Ẩn"))
                                </td>
                                <td width="100">
                                    @String.Format("{0:0,000}", item.UnitPrice)
                                </td>
                                <td align="center" class="tableActs" width="100">
                                    <a href="@Url.Action("Edit", "Product", new { id = item.ProductID })" class="tablectrl_small bDefault tipS" title="Sửa"><span class="iconb" data-icon="&#xe1db;"></span></a>
                                    <a onclick="confirmdelete('Delete/'+@item.ProductID);" class="tablectrl_small bDefault tipS" title="Xóa"><span class="iconb confirm" data-icon="&#xe136;"></span></a>
                                </td>

                            </tr>
                            
                        }
                    </tbody>
                </table>
                <div id="dialogConfirm">Bạn có muốn thực hiện thao tác này</div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
</div>
@section scripts
{
    @Scripts.Render("~/bundles/jquerytable")
    @Scripts.Render("~/bundles/form")
    @Scripts.Render("~/bundles/ui")
    @Scripts.Render("~/Content/Admin/js/files/bootstrap.js")
    @Scripts.Render("~/Content/Admin/js/files/functions.js")

}
